package com.ocm.tourism.core.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.TableGenerator;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;

import org.springframework.beans.factory.annotation.Configurable;

@Entity
@Configurable
public class Album {

   @Id
   @GeneratedValue(strategy=GenerationType.TABLE,generator="GEN_ALBUM")
   @TableGenerator(name = "GEN_ALBUM", table = "SEQUENCE_LIST", allocationSize = 1, initialValue = 1, pkColumnName = "NAME", valueColumnName = "NEXT_SEQUENCE", pkColumnValue = "ALBUM")
   private Long id;

   @NotNull
   private String albumName;

   @NotNull
   private String externalUrl;
   
   @NotNull
   @Enumerated(EnumType.STRING)
   private RepositoryType repositoryType;

   private Long businessId;

   @Version
   @Column(name = "version")
   private Integer version;

   public Long getId() {
      return id;
   }

   public void setId(Long id) {
      this.id = id;
   }

   public String getAlbumName() {
      return albumName;
   }

   public void setAlbumName(String albumName) {
      this.albumName = albumName;
   }

   public String getExternalUrl() {
      return externalUrl;
   }

   public void setExternalUrl(String externalUrl) {
      this.externalUrl = externalUrl;
   }

   public RepositoryType getRepositoryType() {
      return repositoryType;
   }

   public void setRepositoryType(RepositoryType repositoryType) {
      this.repositoryType = repositoryType;
   }

   public Integer getVersion() {
      return version;
   }

   public void setVersion(Integer version) {
      this.version = version;
   }

   public Long getBusinessId() {
      return businessId;
   }

   public void setBusinessId(Long businessId) {
      this.businessId = businessId;
   }
}
